
Files={'57.txt'};
%%
    File=Files{i};
    opts = detectImportOptions(File);
    i=28;
    opts.VariableNamesLine = i;
    opts.VariableUnitsLine=i+1;
    opts.DataLines=[i+2 Inf];
    Rheo=readtable(File,opts);
    T1=50;
    T2=550;
    fig=figure('Position',[100,100,500,400]);
    Rheo.Time=[1:length(Rheo.Meas_Pts_)]'/10;
        plot(Rheo.Time(Rheo.Time>T1&Rheo.Time<=T2),Rheo.Torque(Rheo.Time>T1&Rheo.Time<=T2),'DisplayName','Torque','linewidth',2)
        ylabel('Torque - mNm')
        xlabel('Time - s')
        legend boxoff
        title([' Gap = ', num2str(nanmean(Rheo.Gap),3) ' mm, ShearRate = ' num2str(nanmean(Rheo.ShearRate),4) ' s^{-1}'])
        set(gca,'fontsize',12)
        set(gca,'linewidth',2)  
        box on
        grid on
        xlim([T1,T2])
        print(fig,[strrep(File,'_',' '),' Torque-Time','.png'],'-r800','-dpng');        
    [St,Freq]=FFT_of_signal(Rheo.Time(Rheo.Time>T1&Rheo.Time<=T2),Rheo.Torque(Rheo.Time>T1&Rheo.Time<=T2),false);
    
    fig=figure('Units','inches','Position',[1,1,2,1.6]);
        hold on
        plot(Freq,smooth(St)*10^6,'linewidth',1,'DisplayName','Torque')
        xlabel('f-Hz')
        ylabel('PSD-uNm^2')
        set(gca,'linewidth',1)
        set(gca,'fontsize',8)
        set(gca,'XScale','log')
        set(gca,'YScale','log')
        xlim([min(Freq),max(Freq)])
        xlim([min(Freq),max(Freq)])
        Velocity=4;
        plot(Velocity*[1,1]/2/pi,[1e-10,1e10],'r--','linewidth',1)
        xticks([10^-2,10^0])
        yticks([1,1e6])

        ylim([1e-3,1e8])
        set(gca,'fontname','Arials')  % Set it to times
        box on
        print(fig,[File,' Torque-FFT','.png'],'-r800','-dpng');  
        saveas(fig,[File,' Torque-FFT.eps'],'epsc')

